/*
This codefile contains the functionality of the "SerialWrite" 
component, specified in the design report ("tussenrapport.doc").

Author:			Geert, Daan
Version: 		1
Last modified:	09-06-11
*/

/*
Send a character over the serial connection.
*/
void Serial_Putch (unsigned char ch)
{
	// wait for transmit buffer empty
	while (SSR1_TDRE == 0)
	{
		continue;
	}
	// put ch into buffer
	SODR1 = ch;
}

/*
Send a string over the serial connection.
*/
void Serial_Puts (unsigned char *str)
{
	int i,len;
	len = 30;//strlen(str);

	for (i=0; i<len; i++) 	/* go through string */
	{
		Serial_Putch (str[i]);			/* send it out */
	}
}

/*
Send a character ove the serial interface.
*/
void Serial_Write (unsigned char ch)
{
	Serial_Putch(ch);
}